﻿
var dicBrokers = null;
(function GetBrokers() {
    $.ajax({
        url: "/person/brokers",
        type: "GET",
        dataType: "json",
        success: function (data) {
            dicBrokers = data;
        }
    });
})();
//获取经纪商名称
function GetBrokerName(brokerId) {
    if (dicBrokers == null) {
        return "";
    } else{
        var brokerName = "";
        if (typeof (dicBrokers[brokerId]) != undefined) {
            brokerName = dicBrokers[brokerId];
        }  
    }
  
    //switch (brokerId)
    //{
    //    case 1:
    //        brokerName = "晋峰环球国际";
    //        break;
    //    case 2:
    //        brokerName = "晋峰金银业";
    //        break;
    //    case 3:
    //        brokerName = "模拟账号";
    //        break;
    //    case 4:
    //        brokerName = "FXCM";
    //        break;
    //    case 5:
    //    case 6:
    //        brokerName = "KVB";
    //        break;
    //    case 102:
    //        brokerName = "Admiral艾迪麦";
    //        break;
    //    case 103:
    //        brokerName = "ADS达汇";
    //        break;
    //    case 104:
    //        brokerName = "FOREX.com嘉盛";
    //        break;
    //    case 105:
    //        brokerName = "FxPro浦会";
    //        break;
    //    case 106:
    //        brokerName = "GKFX捷凯";
    //        break;
    //    case 107:
    //        brokerName = "GoMarkets高汇";
    //        break;
    //    case 108:
    //        brokerName = "IG Markets";
    //        break;
    //    case 109:
    //        brokerName = "Pepperstone激石";
    //        break;
    //    case 110:
    //        brokerName = "Tickmill";
    //        break;
    //    case 111:
    //        brokerName = "Markets迈肯司";
    //        break;
    //    case 112:
    //        brokerName = "SVS英国SVSFX";
    //        break;
    //    case 113:
    //        brokerName = "ThinkMarkets智汇";
    //        break;
    //    case 114:
    //        brokerName = "VantageFX万致";
    //        break;
    //    case 115:
    //        brokerName = "XM";
    //        break;
    //    case 116:
    //        brokerName = "Ava爱华";
    //        break;
    //}
    return arguments[1] ? "关联" + brokerName + "经纪商账户" : brokerName;
}